package common;

import java.io.BufferedReader;
import java.io.File;
import java.io.FileReader;
import java.io.IOException;
import java.util.ArrayList;
import java.util.List;

/**
 * @author Administrator
 * @date 2016/8/10
 */
public class UrlList {
    private static List<String> urlList = new ArrayList<String>();

    static {
        BufferedReader br = null;
        try {
            String filePath = UrlList.class.getResource("/urlList.txt").getFile();
            FileReader reader = new FileReader(new File(filePath));
            br = new BufferedReader(reader);
            String str;
            while (null != (str = br.readLine())) {
                if (str.trim().length() == 0 || str.charAt(0) == '#') {
                    continue;
                }
                urlList.add(str);
            }
        } catch (IOException e) {
            e.printStackTrace();
        } finally {
            try {
                if (br != null) {
                    br.close();
                }
            } catch (IOException e) {
                e.printStackTrace();
            }
        }
    }

    public static List<String> getUrlList() {
        return urlList;
    }

}
